package edu.whut.mall.pojo.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.Document;

import java.io.Serializable;
import java.util.Date;

/**
 * Author: smq
 * Unit: D9lab
 * Date: 2021-06-07 16:15
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Document(indexName = "product",type = "_doc")
public class Product implements Serializable {
    private static final long serialVersionUID = 7;
    //自动返回id的值
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String name;

    private String description;

    private Integer merchantId;

    private Boolean isDeleted;

    private Date createTime;

    private Date updateTime;

    private Integer type;

//    private Integer moduleId;

    private String specification;


    public Product(String name, String description, Integer merchantId) {
        this.name = name;
        this.description = description;
        this.merchantId = merchantId;
        this.isDeleted = false;
        this.createTime = new Date();
        this.updateTime = null;
    }
}